//created by yc0576@gmail.com at 2010.12.27
//for debug only
//mainly used for debug output
#import <CoreFoundation/CoreFoundation.h>
#import <UIKit/UIKit.h>
#import <UIKit/UITextView.h>
#import <UIKit/UIFont.h>
#import "debug.h"
//#include <iostream>
 FILE* wfp;
 FILE* rfp;
 const char *YC_ActivePath;
void init_debug()
{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);

NSString *documentsDirectory = [paths objectAtIndex:0];
NSLog(@"%@",documentsDirectory);
NSFileManager *fileManage = [NSFileManager defaultManager];
NSString *myDirectory = [documentsDirectory stringByAppendingPathComponent:@"onscripter"];
BOOL ok = [fileManage createDirectoryAtPath:myDirectory attributes:nil];
NSLog(@"%@",ok);
NSString *path = [myDirectory stringByAppendingPathComponent:@"test.txt"];
NSString *temp = @"Hello friend";

const char *pPath=[path UTF8String];
NSString *pathR=[myDirectory stringByAppendingPathComponent:@"ons.ini"];
const char *pPathR=[pathR UTF8String];
YC_ActivePath = [myDirectory UTF8String];
NSString *pathERR=[myDirectory stringByAppendingPathComponent:@"stderr.txt"];
const char *pPathERR=[pathERR UTF8String];

wfp = fopen (pPath, "w");
rfp = fopen (pPathR,"r");
freopen(pPathERR,"w",stderr);


}/*
void init_debug()
{
	
}*/
